/**
 * 进程等待记录 类
 * resourceId           : 资源编号
 * processId            : 进程 id
 * requestedInstances   : 需要的实例数
 */
public class ProcessWait {

    private int resourceId;
    private int processId;
    private int requestedInstances;

    public ProcessWait(int processId, int resourceId, int requestedInstances) {
        this.processId = processId;
        this.resourceId = resourceId;
        this.requestedInstances = requestedInstances;
    }

    public int getProcessId() {
        return processId;
    }

    public int getResourceId() {
        return resourceId;
    }

    public int getRequestedInstances() {
        return requestedInstances;
    }

    public void setProcessId(int processId) {
        this.processId = processId;
    }

    public void setResourceId(int resourceId) {
        this.resourceId = resourceId;
    }

    public void setRequestedInstances(int requestedInstances) {
        this.requestedInstances = requestedInstances;
    }

    @Override
    public String toString() {
        return String.format("P%d 等待 R%d×%d",
                processId, resourceId, requestedInstances);
    }
}
